from parsers.cron_job import scheduled_tasks
from parsers.querypdf import merge_code
from storage.postgreSql import sql_insert
from utils.logger import settinglog#不要删，自动初始化日志设置
from interface.interface import interfaces
import logging
import sys
import os

# 获取当前脚本的绝对路径
current_script_path = os.path.abspath(__file__)
# 获取当前脚本所在的目录
current_script_dir = os.path.dirname(current_script_path)
# 将当前脚本所在的目录添加到 sys.path 中
if current_script_dir not in sys.path:
    sys.path.append(current_script_dir)

def main_tasks():
    logging.info("程序运行main-tasks")
    print("程序运行main:main_tasks")
    list=merge_code('合并利润表')
    sql_insert(list,'test')

def main_tasks1():
    logging.info("程序运行main-tasks1")
    print("程序运行main:main_tasks1")
    list=merge_code('母公司利润表')
    sql_insert(list,'test_1')

if __name__=='__main__':
    logging.info("程序启动")
    interfaces()
    # tasks()
    # scheduled_tasks()